package cn.boy.service.impl;

import cn.boy.dao.AdminstratorDao;
import cn.boy.dao.AdminstratorDaoFactory;
import cn.boy.domain.Adminstrator;
import cn.boy.service.AdminstratorService;


public class AdminstratorServiceImpl implements AdminstratorService {

	private static AdminstratorDaoFactory instance;
	private static AdminstratorDao dao;
	static{
		instance = AdminstratorDaoFactory.getInstance();
		dao= instance.getAdminstratorDao();
	}

	public void register(Adminstrator admin){
		dao.add(admin);
	}
	
	public void deleteAdminstrator(String no){
		dao.delete(no);
	}
	
	public void updateAdminstrator(Adminstrator admin){
		dao.update(admin);
	}
	
	public void updateAdminstrator(String no,String password){
		dao.update(no, password);
	}
	
	public String queryAllAdminstrator(){
		return dao.queryAll();
	}
	public String queryAdminstratorByDepartment(String department){
		return dao.queryAdminstratorsByDepartment(department);
	}
	
	public String queryAdminstrator(String no){
		return dao.query(no);
	}
	
	public String login(String no,String password){
		return dao.query(no, password);
	}

	
	
	
}
